import java.io.File;
import java.io.IOException;
import java.util.Arrays;

public class Demo4 {

    public static void main(String[] args) {
        File path = new File("c:/");
        String[] list = path.list();
        System.out.println(Arrays.toString(list));

        File[] lists = path.listFiles();
        System.out.println(Arrays.toString(lists));
    }


    public static void main1(String[] args) throws IOException {
        File path = new File("./test.txt");

        System.out.println(path.exists());
        System.out.println(path.createNewFile());
        System.out.println(path.exists());
        path.deleteOnExit();
        System.out.println(path.exists());
    }
}
